﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="EcommFashion.WomenGroupedItemsPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:EcommFashion"
    xmlns:data="using:EcommFashion.Data"
    xmlns:common="using:EcommFashion.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">


	<Page.TopAppBar>
        <AppBar x:Name="TopApp" Padding="10,0,10,0" MinHeight="110" Background="#D1000000" BorderBrush="#D1000000">
            <Grid Height="100" Margin="40,0">
        		<StackPanel Margin="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
        			<Button x:Name="btnHome" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Padding="0" Style="{StaticResource TopAppbarBtnStyle}" Click="btnHome_Click" >
        				<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Height="92" Margin="0" Width="92">
        					<Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/AppBarBtn/HomeappbarBtn.png" Width="92" Margin="0" Height="92"/>
        				</Grid>
        			</Button>
        			<Button x:Name="btnMale" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Padding="0" Style="{StaticResource TopAppbarBtnStyle}" Margin="10,0,0,0" >
        				<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Height="92" Margin="0" Width="92">
        					<Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/AppBarBtn/MaleappBarBtn.png" Width="92" Margin="0" Height="92"/>
        				</Grid>
        			</Button>
        			<Button x:Name="btnFemale" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Padding="0" Style="{StaticResource TopAppbarBtnStyle}" Margin="10,0,0,0" >
        				<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Height="92" Margin="0" Width="92">
        					<Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/AppBarBtn/FemaleAppbarBtn.png" Width="92" Margin="0" Height="92"/>
        				</Grid>
        			</Button>

        		</StackPanel>
        	</Grid>
        </AppBar>
    </Page.TopAppBar>
    <Page.BottomAppBar>
        <AppBar x:Name="BottamApp" Padding="10,0,10,0" MinHeight="90" Background="#D1000000" BorderBrush="#D1000000">
            <Grid Margin="40,10,30,10" HorizontalAlignment="Right">
                <StackPanel Margin="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
                    <Button x:Name="btnMyCart" HorizontalAlignment="Right" BorderBrush="{x:Null}" BorderThickness="0" FontWeight="Normal" VerticalAlignment="Stretch" Padding="0" Style="{StaticResource TopAppbarBtnStyle}" Click="btnMyCart_Click" >
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center" Height="75" Margin="0" Width="75">
                        	<Grid.RowDefinitions>
                        		<RowDefinition Height="57"/>
                        		<RowDefinition Height="18"/>
                        	</Grid.RowDefinitions>
                            <Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="Assets/AppBarBtn/ShoppingAppBarBtn.png" Width="57" Margin="0" Height="57"/>
                            <StackPanel Margin="6,0" Orientation="Horizontal" Grid.Row="1">
                            	<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="my cart" VerticalAlignment="Bottom" FontSize="13.333"/>
                            	<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="(3)" VerticalAlignment="Bottom" FontSize="13.333" Margin="3,0,0,0"/>
                            </StackPanel>
                        </Grid>
                    </Button>

                </StackPanel>
            </Grid>
        </AppBar>
    </Page.BottomAppBar>
    
    

    <Page.Resources>

        <!--
            Collection of grouped items displayed by this page, bound to a subset
            of the complete item list because items in groups cannot be virtualized
        -->
        <CollectionViewSource
            x:Name="groupedItemsViewSource"
            Source="{Binding Groups}"
            IsSourceGrouped="true"
            ItemsPath="TopItems"
            d:Source="{Binding AllGroups, Source={d:DesignInstance Type=data:WomenDataSource, IsDesignTimeCreatable=True}}"/>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}" Background="#FF3E4849">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Horizontal scrolling grid used in most view states -->

        <!-- Vertical scrolling list only used when snapped -->
        <ListView
            x:Name="itemListView"
            AutomationProperties.AutomationId="ItemListView"
            AutomationProperties.Name="Grouped Items"
            Grid.Row="1"
            Visibility="Collapsed"
            Margin="0,-10,0,0"
            Padding="10,0,0,60"
            ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
            ItemTemplate="{StaticResource Standard80ItemTemplate}"
            SelectionMode="None"
            IsSwipeEnabled="false"
            IsItemClickEnabled="True"
            ItemClick="ItemView_ItemClick">

            <ListView.GroupStyle>
                <GroupStyle>
                    <GroupStyle.HeaderTemplate>
                        <DataTemplate>
                            <Grid Margin="7,7,0,0">
                                <Button
                                    AutomationProperties.Name="Group Title"
                                    Click="Header_Click"
                                    Style="{StaticResource TextPrimaryButtonStyle}">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Title}" Margin="3,-7,10,10" Style="{StaticResource GroupHeaderTextStyle}" />
                                        <TextBlock Text="{StaticResource ChevronGlyph}" FontFamily="Segoe UI Symbol" Margin="0,-7,0,10" Style="{StaticResource GroupHeaderTextStyle}"/>
                                    </StackPanel>
                                </Button>
                            </Grid>
                        </DataTemplate>
                    </GroupStyle.HeaderTemplate>
                </GroupStyle>
            </ListView.GroupStyle>
        </ListView>

        <!-- Back button and page title -->
        <ScrollViewer x:Name="scrollViewer" Grid.RowSpan="2" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" Background="Transparent"
                      ZoomMode="Disabled" VerticalScrollMode="Disabled">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="47*"/>
                    <ColumnDefinition Width="53*"/>
                </Grid.ColumnDefinitions>
                <Grid x:Name="grdMainImage">
                    <Image Source="Assets/WomenPage/WomenPageMain.png" Stretch="Fill" Margin="0"/>
                    <Grid HorizontalAlignment="Right" Height="80" VerticalAlignment="Bottom" Width="455" Margin="0,0,0,110" Background="#EA1E2324">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="278"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <StackPanel Margin="15,10,0,10">
                            <TextBlock TextWrapping="Wrap" Text="Lorem ipsum dolor" FontFamily="Segoe UI" FontSize="24" FontWeight="Bold"/>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock TextWrapping="Wrap" Text="category:" FontFamily="Segoe UI" FontSize="16"/>
                                <TextBlock TextWrapping="Wrap" Text="women" FontFamily="Segoe UI" FontSize="16" Margin="5,0,0,0"/>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="0,13" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Width="177">
                            <TextBlock TextWrapping="Wrap" Text="Rs." FontFamily="Segoe UI" FontSize="18.667" VerticalAlignment="Bottom" LineStackingStrategy="BlockLineHeight" Margin="0,0,0,3"/>
                            <TextBlock TextWrapping="Wrap" Text="830.00" FontFamily="Segoe UI" FontSize="40" Margin="5,0,0,0" VerticalAlignment="Bottom" LineStackingStrategy="BlockLineHeight" LineHeight="40"/>
                        </StackPanel>
                    </Grid>
                </Grid>
                <GridView
        			x:Name="itemGridView"
        			AutomationProperties.AutomationId="ItemGridView"
        			AutomationProperties.Name="Grouped Items"
        			Padding="116,137,40,46"
        			ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
        			ItemTemplate="{StaticResource Standard250x250ItemTemplate}"
        			SelectionMode="None"
        			IsSwipeEnabled="false"
        			IsItemClickEnabled="True"
        			ItemClick="ItemView_ItemClick" Margin="0" Grid.Column="1">

                    <GridView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel Orientation="Horizontal" Margin="0,0,40,0"/>
                        </ItemsPanelTemplate>
                    </GridView.ItemsPanel>
                    <GridView.GroupStyle>
                        <GroupStyle>
                            <GroupStyle.HeaderTemplate>
                                <DataTemplate>
                                    <Grid Margin="1,0,0,6">
                                        <Button
        									AutomationProperties.Name="Group Title"
        									Click="Header_Click"
        									Style="{StaticResource TextPrimaryButtonStyle}" >
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding Title}" Margin="3,-7,10,10" Style="{StaticResource GroupHeaderTextStyle}" />
                                                <TextBlock Text="{StaticResource ChevronGlyph}" FontFamily="Segoe UI Symbol" Margin="0,-7,0,10" Style="{StaticResource GroupHeaderTextStyle}"/>
                                            </StackPanel>
                                        </Button>
                                    </Grid>
                                </DataTemplate>
                            </GroupStyle.HeaderTemplate>
                            <GroupStyle.Panel>
                                <ItemsPanelTemplate>
                                    <VariableSizedWrapGrid Orientation="Vertical" Margin="0,0,80,0"/>
                                </ItemsPanelTemplate>
                            </GroupStyle.Panel>
                        </GroupStyle>
                    </GridView.GroupStyle>
                </GridView>
            </Grid>
        </ScrollViewer>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <Grid x:Name="grid" HorizontalAlignment="Right" Height="80" VerticalAlignment="Top" Width="230" Margin="0,0,110,0" Background="#FF748181" Grid.Column="1">
                <Image HorizontalAlignment="Right" Height="77" VerticalAlignment="Center" Width="203" Source="Assets/Logo.png" Margin="0,0,10,0"/>
            </Grid>
            <StackPanel Grid.Column="1" Margin="0,0,0,40" Orientation="Vertical" VerticalAlignment="Bottom">
            	<TextBlock x:Name="pageTitle" IsHitTestVisible="false" Style="{StaticResource PageHeaderTextStyle}" Text="women" Margin="0" Foreground="#FF1E2324"/>
            	<TextBlock TextWrapping="Wrap" Text="formal dresses" FontFamily="Segoe UI" FontSize="32" Visibility="Collapsed"/>
            </StackPanel>
        </Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>

                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemGridView" Storyboard.TargetProperty="Padding">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="96,137,10,56"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!--
                    The back button and title have different styles when snapped, and the list representation is substituted
                    for the grid displayed in all other view states
                -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>

                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemListView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="itemGridView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="scrollViewer">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<Visibility>Collapsed</Visibility>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="grid">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<Visibility>Collapsed</Visibility>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TopApp">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<Visibility>Collapsed</Visibility>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ColorAnimation Duration="0" To="White" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="pageTitle" d:IsOptimized="True"/>
                        <DoubleAnimation Duration="0" To="48" Storyboard.TargetProperty="(TextBlock.FontSize)" Storyboard.TargetName="pageTitle" d:IsOptimized="True"/>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
